package data;

import java.awt.Graphics2D;
import java.awt.image.BufferedImage;

import main.Core;

/**
 * 
 * @author Ygor
 * 
 */
public class ImageSprite extends SceneObject {
	private BufferedImage bufferedImage;
	private int x;
	private int y;
	private int height;
	private int width;
	private boolean visible;

	@Override
	public void Update(double ElapsedTime) {

	}

	@Override
	public void Draw(Graphics2D g) {
		if (visible) {
			g.drawImage(bufferedImage, x, y, width, height, null);
		}
	}

	public ImageSprite(BufferedImage img, int X, int Y, int w, int h, Core c) {
		super(c);
		this.bufferedImage = img;
		this.x = X;
		this.y = Y;
		this.width = w;
		this.height = h;
		visible = true;
	}

	/**
	 * @return the bufferedImage
	 */
	public BufferedImage getBufferedImage() {
		return bufferedImage;
	}

	/**
	 * @param bufferedImage
	 *            the bufferedImage to set
	 */
	public void setBufferedImage(BufferedImage bufferedImage) {
		this.bufferedImage = bufferedImage;
	}

	/**
	 * @return the x
	 */
	public int getX() {
		return x;
	}

	/**
	 * @param x
	 *            the x to set
	 */
	public void setX(int x) {
		this.x = x;
	}

	/**
	 * @return the y
	 */
	public int getY() {
		return y;
	}

	/**
	 * @param y
	 *            the y to set
	 */
	public void setY(int y) {
		this.y = y;
	}

	/**
	 * @return the height
	 */
	public int getHeight() {
		return height;
	}

	/**
	 * @param height
	 *            the height to set
	 */
	public void setHeight(int height) {
		this.height = height;
	}

	/**
	 * @return the width
	 */
	public int getWidth() {
		return width;
	}

	/**
	 * @param width
	 *            the width to set
	 */
	public void setWidth(int width) {
		this.width = width;
	}

	/**
	 * @return the visible
	 */
	public boolean isVisible() {
		return visible;
	}

	/**
	 * @param visible
	 *            the visible to set
	 */
	public void setVisible(boolean visible) {
		this.visible = visible;
	}

}
